// 项目成员管理
var mbersColumns = [{
  id: 'meberName',
  title: '人员姓名',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'meberJob',
  title: '担任角色',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'joinTime',
  title: '加入时间',
  type: 'string',
  width: 100,
  columnClass: 'text-left',
}, {
  id: 'test',
  title: '说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.meberName + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var mbersOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目成员',
  datas: [{
    meberName: '张三',
    meberJob: '项目经理',
    joinTime: '9999-99-99',
    test: '说明测试数据'
  }, ],
  columns: mbersColumns,
  gridContainer: 'mbersContainer',
  toolbarContainer: 'mbersToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var mbersGrid = $.fn.dlshouwen.grid.init(mbersOption);
$(function () {
  mbersGrid.load();
});

// 成员操作权限全选效果
$('.line-check').change(function () {
  var status = $(this).prop("checked");
  if (status) {
    $(this).parent().parent().find(':checkbox').attr("checked", true)
  } else {
    $(this).parent().parent().find(':checkbox').attr("checked", false)
  }
});

// 项目整体进展管理
var prgColumns = [{
    id: 'time',
    title: '日期',
    type: 'string',
    width: 100,
    columnClass: 'text-left',
  },
  {
    id: 'status',
    title: '项目状态',
    type: 'string',
    codeTable: status,
    width: 100,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      if (value == 1) {
        content += '<span style="background:#5bc0de;padding:2px 10px;color:white;">运行中</span>';
      }
      if (value == 2) {
        content += '<span style="background:#d9534f;padding:2px 10px;color:white;">已关闭</span>';
      }
      if (value == 3) {
        content += '<span style="background:#5cb85c;padding:2px 10px;color:white;">已完结</span>';
      }
      if (value == 4) {
        content += '<span style="background:#f8d347;padding:2px 10px;color:white;">已暂停</span>';
      }
      return content;
    }
  }, {
    id: 'prgmsg',
    title: '项目整体进展',
    type: 'string',
    columnClass: 'text-left',
  }, {
    id: 'nextmsg',
    title: '下一步计划',
    type: 'string',
    columnClass: 'text-left',
  }, {
    id: 'operation',
    title: '操作',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.indName + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
      return content;
    }
  }
];
var prgOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目整体进展',
  datas: [{
    time: '2019-09-01',
    status: 1,
    prgmsg: '项目整体进展测试数据',
    nextmsg: '下一步计划测试数据'
  }, ],
  columns: prgColumns,
  gridContainer: 'prgContainer',
  toolbarContainer: 'prgToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var prgGrid = $.fn.dlshouwen.grid.init(prgOption);
$(function () {
  prgGrid.load();
});

// 项目风险管理
var riskColumns = [{
  id: 'time',
  title: '日期',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'lv',
  title: '级别',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'status',
  title: '风险状态',
  type: 'string',
  codeTable: status,
  width: 100,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    if (value == 1) {
      content += '<span style="background:#d9534f;padding:2px 10px;color:white;">开启中</span>';
    }
    if (value == 2) {
      content += '<span style="background:#5cb85c;padding:2px 10px;color:white;">已关闭</span>';
    }
    return content;
  }
}, {
  id: 'test',
  title: '风险和问题',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'plando',
  title: '预规避和处理措施',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.indName + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var riskOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目风险',
  datas: [{
    time: '2019-09-01',
    lv: '高',
    status: 1,
    test: '风险和问题测试数据',
    plando: '预规避和处理措施测试数据'
  }, ],
  columns: riskColumns,
  gridContainer: 'riskContainer',
  toolbarContainer: 'riskToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var riskGrid = $.fn.dlshouwen.grid.init(riskOption);
$(function () {
  riskGrid.load();
});

// 决策上报
var makingColumns = [{
  id: 'time',
  title: '日期',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'lv',
  title: '录入人',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 'plando',
  title: '内容',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.lv + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var makingOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '决策上报',
  datas: [{
    time: '2019-09-01',
    lv: '张三',
    plando: '决策上报内容测试数据'
  }, ],
  columns: makingColumns,
  gridContainer: 'makingContainer',
  toolbarContainer: 'makingToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var makingGrid = $.fn.dlshouwen.grid.init(makingOption);
$(function () {
  makingGrid.load();
});

// 项目变更记录管理
var changeColumns = [{
  id: 'time',
  title: '日期',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'lv',
  title: '级别',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'test',
  title: '变更说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.indName + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var changeOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目变更',
  datas: [{
    time: '2018-06-10',
    lv: '高',
    test: '变更说明测试数据',
  }, ],
  columns: changeColumns,
  gridContainer: 'changeContainer',
  toolbarContainer: 'changeToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var changeGrid = $.fn.dlshouwen.grid.init(changeOption);
$(function () {
  changeGrid.load();
});

// OKR计划和分配
var okrColumns = [{
  id: 'zhouqi',
  title: '周期',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'mubiao',
  title: '阶段目标',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'renwu',
  title: '标准任务',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'chengguo',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'time',
  title: '完成时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'kr',
  title: 'KR权重',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 'user',
  title: '成员',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 'job',
  title: '角色',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, ];
var okrOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR计划和分配',
  datas: [{
    zhouqi: 'Q1',
    mubiao: '阶段目标测试数据',
    renwu: '标准任务测试数据',
    chengguo: '关键成果测试数据',
    time: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    job: '项目经理测试'
  }, ],
  columns: okrColumns,
  gridContainer: 'okrContainer',
  toolbarContainer: 'okrToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var okrGrid = $.fn.dlshouwen.grid.init(okrOption);
$(function () {
  okrGrid.load();
});

// OKR子任务进展
var childrenColumns = [{
  id: 'zhouqi',
  title: '周期',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'mubiao',
  title: '阶段目标',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'renwu',
  title: '标准任务',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'chengguo',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'planTime',
  title: '计划完成时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'kr',
  title: 'KR权重',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 'user',
  title: '成员',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 't100',
  title: '投入百分比',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'krover',
  title: 'KR完成率',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'e100',
  title: '实际投入百分比',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'domsg',
  title: '子任务进展',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'nextmsg',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'krp',
  title: 'KR得分',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'op',
  title: 'O得分',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'time',
  title: '更新时间',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'operation',
  title: '操作',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="rechildren(' + record.id + ');"><i class="icon-refresh"></i>  更新</button>';
    return content;
  }
}];
var childrenOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR子任务进展',
  datas: [{
    id: 1,
    zhouqi: 'Q1',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, {
    id: 2,
    zhouqi: 'Q2',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, {
    id: 3,
    zhouqi: 'Q3',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, ],
  columns: childrenColumns,
  gridContainer: 'childrenContainer',
  toolbarContainer: 'childrenToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childrenGrid = $.fn.dlshouwen.grid.init(childrenOption);
$(function () {
  childrenGrid.load();
});
// 子任务数据更新
function rechildren(id) {
  location.href = './edit/edit-children.html';
}
// OKR子任务进展
var childLogColumns = [{
  id: 'zhouqi',
  title: '周期',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'mubiao',
  title: '阶段目标',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'renwu',
  title: '标准任务',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'chengguo',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'planTime',
  title: '计划完成时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'kr',
  title: 'KR权重',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 'user',
  title: '成员',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 't100',
  title: '投入百分比',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'krover',
  title: 'KR完成率',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'e100',
  title: '实际投入百分比',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'domsg',
  title: '子任务进展',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'nextmsg',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'krp',
  title: 'KR得分',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'op',
  title: 'O得分',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'time',
  title: '更新时间',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, ];
var childLogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR子任务进展',
  datas: [{
    id: 1,
    zhouqi: 'Q2',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    krover: '20%',
    e100: '34%',
    domsg: '子任务进展测试数据',
    nextmsg: '下一步计划测试数据',
    krp: '20分',
    op: '30分',
    time: '2018-06-10',
  }, ],
  columns: childLogColumns,
  gridContainer: 'childLogContainer',
  toolbarContainer: 'childLogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childLogGrid = $.fn.dlshouwen.grid.init(childLogOption);
$(function () {
  childLogGrid.load();
});
// 子任务自评得分
var childColumns = [{
  id: 'zhouqi',
  title: '周期',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'mubiao',
  title: '阶段目标',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'renwu',
  title: '标准任务',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'chengguo',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'planTime',
  title: '计划完成时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'kr',
  title: 'KR权重',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 'user',
  title: '成员',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 't100',
  title: '投入百分比',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'f1',
  title: '积极性',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f2',
  title: '沟通能力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f3',
  title: '团队协作性',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f4',
  title: '创新力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f5',
  title: '承诺性',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f6',
  title: '抗压力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f7',
  title: '执行力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f8',
  title: '责任心',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f9',
  title: '劳动态度',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f10',
  title: '总得分',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="editChild(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var childOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '子任务自评得分',
  datas: [{
    zhouqi: 'Q1',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    f1: '10分',
    f2: '10分',
    f3: '10分',
    f4: '10分',
    f5: '10分',
    f6: '10分',
    f7: '10分',
    f8: '10分',
    f9: '10分',
    f10: '100分',
  }, ],
  columns: childColumns,
  gridContainer: 'childContainer',
  toolbarContainer: 'childToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childGrid = $.fn.dlshouwen.grid.init(childOption);
$(function () {
  childGrid.load();
});
// 子任务自评
function editChild(id) {
  location.href = './edit/edit-child.html';
}
// OKR子任务评分
var childsColumns = [{
  id: 'zhouqi',
  title: '周期',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'mubiao',
  title: '阶段目标',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'renwu',
  title: '标准任务',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'chengguo',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'planTime',
  title: '计划完成时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'kr',
  title: 'KR权重',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 'user',
  title: '成员',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
}, {
  id: 't100',
  title: '投入百分比',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'f1',
  title: '积极性',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f2',
  title: '沟通能力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f3',
  title: '团队协作性',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f4',
  title: '创新力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f5',
  title: '承诺性',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f6',
  title: '抗压力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f7',
  title: '执行力',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f8',
  title: '责任心',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f9',
  title: '劳动态度',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'f10',
  title: '总得分',
  type: 'string',
  columnClass: 'text-center',
  hideType: 'xs|sm|md|lg',
}, {
  id: 'operation',
  title: '操作',
  width: 130,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="editChilds(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var childsOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR子任务评分',
  datas: [{
    zhouqi: 'Q1',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    f1: '10分',
    f2: '10分',
    f3: '10分',
    f4: '10分',
    f5: '10分',
    f6: '10分',
    f7: '10分',
    f8: '10分',
    f9: '10分',
    f10: '100分',
  }, ],
  columns: childsColumns,
  gridContainer: 'childsContainer',
  toolbarContainer: 'childsToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childsGrid = $.fn.dlshouwen.grid.init(childsOption);
$(function () {
  childsGrid.load();
});

// 子任务得分
function editChilds(id) {
  location.href = './edit/edit-childs.html';
}

// OKR负责人自评
var childbColumns = [{
  id: 'zhouqi',
  title: '周期',
  width: 50,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'f0',
  title: '领导力',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'f1',
  title: '积极性',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'f2',
  title: '沟通能力',
  type: 'string',
  columnClass: 'text-center',
  width: 60,
}, {
  id: 'f3',
  title: '团队协作性',
  type: 'string',
  columnClass: 'text-center',
  width: 70,
}, {
  id: 'f4',
  title: '创新力',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'f5',
  title: '承诺性',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'f6',
  title: '抗压力',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'f7',
  title: '执行力',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'f8',
  title: '责任心',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'f9',
  title: '劳动态度',
  type: 'string',
  columnClass: 'text-center',
  width: 60,
}, {
  id: 'f10',
  title: '总得分',
  type: 'string',
  columnClass: 'text-center',
  width: 50,
}, {
  id: 'operation',
  title: '操作',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="editChildb(' + record.id + ');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var childbOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: 'OKR负责人自评',
  datas: [{
    zhouqi: 'Q1',
    mubiao: '阶段目标测试数',
    renwu: '标准任务测试数',
    chengguo: '关键成果测试数',
    planTime: '2018-06-10',
    kr: '25%',
    user: '张三测试',
    t100: '100%',
    f0: '10分',
    f1: '10分',
    f2: '10分',
    f3: '10分',
    f4: '10分',
    f5: '10分',
    f6: '10分',
    f7: '10分',
    f8: '10分',
    f9: '10分',
    f10: '110分',
  }, ],
  columns: childbColumns,
  gridContainer: 'childbContainer',
  toolbarContainer: 'childbToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var childbGrid = $.fn.dlshouwen.grid.init(childbOption);
$(function () {
  childbGrid.load();
});


// 负责人自评
function editChildb(id) {
  location.href = './edit/edit-childb.html';
}




$(function () {
  var gridColumns_2_2_3 = [{
      id: 'userName',
      title: '用户姓名',
      type: 'string',
      width: 100,
      columnClass: 'text-center',
      fastQuery: true,
      fastQueryType: 'eq'
    },
    {
      id: 'position',
      title: '岗位名称',
      type: 'string',
      width: 120,
      columnClass: 'text-center',
      fastQuery: true,
      fastQueryType: 'lk'
    },
    {
      id: 'time',
      title: '入职时间',
      type: 'string',
      columnClass: 'text-center',
      fastQuery: true,
      fastQueryType: 'lk'
    },
    {
      id: 'operation',
      title: '操作',
      type: 'string',
      width: 100,
      columnClass: 'text-center',
      resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '';
        content += '<button class="btn btn-xs btn-success" onclick="layer.msg(\'选择' + record.userName + '信息\');"><i class="icon-ok"></i>  确认选择</button>';
        return content;
      }
    }
  ];
  var gridOption_2_2_3 = {
    lang: 'zh-cn',
    ajaxLoad: false,
    // loadURL: '/grid/demo/datas/ajax',
    exportFileName: '用户列表',
    datas: [{
      userName: '张三',
      position: '总经理',
      time: '2018-01-02 14:80',
    }, {
      userName: '李四',
      position: '总经理',
      time: '2018-01-02 14:80',
    }, {
      userName: '王五',
      position: '总经理',
      time: '2018-01-02 14:80',
    }, {
      userName: '陈六',
      position: '总经理',
      time: '2018-01-02 14:80',
    },{
      userName: '陈六',
      position: '总经理',
      time: '2018-01-02 14:80',
    },  ],
    columns: gridColumns_2_2_3,
    gridContainer: 'gridContainer_2_2_3',
    toolbarContainer: 'gridToolBarContainer_2_2_3',
    tools: '',
    pageSize: 5,
    pageSizeLimit: [5, 10, 20]
  };
  var grid_2_2_3 = $.fn.dlshouwen.grid.init(gridOption_2_2_3);
  $(function () {
    grid_2_2_3.load();
  });

  // 获取焦点显示
  $(".perName").focus(function () {
    $(".pdmiddle").show();
  });
})

function pdclose(){
  $(".pdmiddle").hide();
};
